home *** CD-ROM | disk | FTP | other *** search
- var immobile = true;
- var pitchSpeed = 200 - psy;
- var pitchDistance = 0;
- var playerSpeed = 0;
- var playerDistance = 0;
- var runStage = 0;
- onEnterFrame = function()
- {
- pitchDistance += pitchSpeed / 144;
- playerDistance += playerSpeed / 144;
- pitchSpeed *= 0.9999;
- pitchDistanceRnd = Math.round(pitchDistance) - Math.round(playerDistance);
- pitchSpeedRnd = Math.round(pitchSpeed);
- playerSpeedRnd = Math.round(playerSpeed);
- if(!immobile)
- {
- switch(runStage)
- {
- case 0:
- if(Key.isDown(39))
- {
- playerSpeed++;
- runStage = 1;
- }
- else if(Key.isDown(37))
- {
- playerSpeed++;
- runStage = 2;
- }
- break;
- case 1:
- if(Key.isDown(37))
- {
- playerSpeed++;
- runStage = 2;
- }
- break;
- case 2:
- if(Key.isDown(39))
- {
- playerSpeed++;
- runStage = 1;
- }
- }
- }
- };
- ball.onEnterFrame = function()
- {
- this._x += 100;
- if(this._x > Stage.width + 20)
- {
- delete this.onEnterFrame;
- }
- };
-